import { 汉字式子2表达式 } from "./expression-translate";
export * from "./expression-translate";

export function 汉字式子运算(语句: string) {
  const 表达式 = 汉字式子2表达式(语句);
  const f = new Function(`return (${表达式})`);
  try {
    return f();
  } catch (e) {
    throw new Error(`“${语句}”不是合法的式子`);
  }
}
